home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / srefv12i.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-03-27  |  58KB  |  1,762 lines

  1. /* this is the SRE-FILTER installation program */
  2.  
  3. /* Load up advanced REXX functions */
  4. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. call SysLoadFuncs
  6.  
  7. initfilt_file=''
  8. copyall=0
  9. echo off
  10. /* --- Load the tcp/ip function library, if necessary --- */
  11. if RxFuncQuery("SockLoadFuncs")=1 then  do    /* not there */
  12.   call RxFuncAdd "SockLoadFuncs","rxSock","SockLoadFuncs"
  13.   call SockLoadFuncs
  14. end
  15.  
  16. thishost=' '
  17.  
  18. parse version  atype .
  19. if atype<>"REXXSAA" then do
  20.  say    " WARNING: SRE-Filter ver 1.2i is designed to work under Classic Rexx "
  21.  say     " In particular, it does NOT work under Object Rexx. "
  22.  say     " Other versions of REXX, such as Quercus's REXX, have not been tested."
  23.  say " Note: You are using REXX version: " atype
  24.  say " (hit ENTER to continue) "
  25.   pull .
  26. end  /* Do */
  27.  
  28.  
  29. dropunz=0 ;
  30. foo=rxfuncquery('UZLoadFuncs')   /* load UNZIP dll */
  31. if foo=1 then do
  32.   dropunz=1
  33.   call RxFuncAdd 'UZLoadFuncs', 'UNZIPAPI', 'UZLoadFuncs'
  34.   call UZLoadFuncs
  35. end
  36. foo=rxfuncquery('UZLoadFuncs')
  37. gotunz=1
  38. if foo=1 then do
  39.     say " Can not find UNZIP procedure library: UNZIPAPI.DLL"
  40.     say "  Did you download it? "
  41.     say " (hit ENTER to continue)"
  42.     parse pull gunk
  43.     gotunz=0 ; dropunz=0
  44. end  /* Do */
  45.  
  46. /*---- load the rexxlib library */
  47. droprxlib=0 ; gotrxlib=1
  48. foo=rxfuncquery('rexxlibregister')
  49. if foo=1 then do
  50.  droprxlib=1 ; gotrxlib=0
  51.  call rxfuncadd 'rexxlibregister','rexxlib', 'rexxlibregister'
  52.  call rexxlibregister
  53. end
  54. foo=rxfuncquery('rexxlibregister')
  55. if foo=1 then do
  56.     say " Could not find the REXXLIB procedure library (REXXLIB.DLL). "
  57.     say "  Did you download it? "
  58.     exit
  59. end  /* Do */
  60.  
  61.  
  62. ansion=checkansi()
  63. if ansion=1 then do
  64.   aesc='1B'x
  65.   cy_ye=aesc||'[37;46;m'
  66.   normal=aesc||'[0;m'
  67.   bold=aesc||'[1;m'
  68.   re_wh=aesc||'[31;47;m'
  69.   reverse=aesc||'[7;m'
  70. end
  71. else do
  72.   say " Warning: Could not detect ANSI....  Install will look ugly ! "
  73.   cy_ye="" ; normal="" ; bold="" ;re_wh="" ;
  74.   reverse=""
  75. end  /* Do */
  76.  
  77. cls
  78. say  " " ; say
  79.  
  80. call lineout, bold cy_ye
  81. call lineout, "This is the SRE-FILTER  (v 1.2i) installation program (2/97)."
  82. call lineout, "... an HTTP filter for the GoServe OS/2 Internet Server      "
  83. call lineout, normal
  84.  
  85.  
  86. say " This program will ask for the names of a few directories,"
  87. say " and will copy a number of files to these directories."
  88. say "  "
  89.  
  90. if yesno(" Are you ready to continue ")=1 then
  91.  nop
  92. else do
  93.  say " See you later?.. "
  94.  exit
  95. end
  96.  
  97. /* defaults */
  98.     datadir="your GoServe Data-directory"
  99.     workdir="your GoServe Working-directory"
  100.     helpdir='the SAMPLES/ subdirectory of the GoServe Data-directory'
  101.     useindex='  '
  102.  
  103. if yesno(" Install (I), or review the installation notes (R)",,'I R')=0 then do
  104.     say " okay, reviewing installation notes.  ... "
  105.     say ' '
  106.    signal gonotes
  107. end
  108.  
  109.  
  110. /* check status of goserver and macrospace routines */
  111. a=dospidlist(l1,l2)
  112. do mm=1 to a
  113.  foo=upper(strip(filespec('n',l2.mm)))
  114.  if foo='GOSERVE.EXE' then do
  115.      say bold " GOSERVE appears to be running " normal
  116.      say " Please shut down GOSERVE  before you (re) install SRE-Filter! "
  117.       exit
  118.   end  /* Do */
  119. end /* do */
  120.  
  121. nosref0=1
  122. signal on syntax name nosref
  123. filter_name=sref_version()   /* if not here, then skip to nosref */
  124. nosref0=0
  125. nosref:         /* if skipped here, then load .rxl */
  126. signal off syntax
  127. if nosref0=0 then do
  128.      say " "
  129.      say bold "A prior version of the SRE-Filter macrospace  procedures " normal " was detected."
  130.      say " We recommend clearing macrospace before you install SRE-Filter."
  131.      say " However, this might adversely impact other programs (that may also "
  132.      say " use REXX's macrospace). "
  133.      ok=yesno(" Clear macrospace now (Y) ?")
  134.      if ok=1 then do
  135.         say " .... clearing macrospace "
  136.         foo=macroclear()
  137.         say " "
  138.      end  /* Do */
  139.      else do
  140.           say " "
  141.         say  bold " Macrospace will not be cleared. " normal
  142.         say " When you are ready to run GOSERVE with SRE-Filter, we recommend "
  143.         say " that you first reboot your server (otherwise SRE-Filter will,"
  144.         say " inappropriately, attempt to use the old procedure library)."
  145.           say " "
  146.  
  147.      end  /* Do */
  148.  
  149. end  /* Do */
  150.  
  151.  
  152.  
  153. install_all=yesno(" Full installation (F), or just upgrade executables (U)",,'F U')
  154. if install_all=0 then do
  155.   say " Parameters will NOT be modified (you might want to read the upgraders notes) "
  156.  
  157. end
  158.  
  159. if install_all=0 then signal skip
  160.  
  161. say " First,what is your IP address (it will be given OWNERS status)"
  162. ipaddr=" "
  163. thishost=get_hostname()
  164. sagain:
  165. call charout , BOLD "What is your IP address (ENTER="thishost "):? " normal
  166. pull youraddr
  167. if youraddr=' ' then youraddr=thishost
  168.  
  169. parse var youraddr t1 '.' .
  170. isnum=0
  171. if  datatype(t1)='NUM' then
  172.   isnum=1
  173. say " wait while that address is checked ... "
  174. chk=host(youraddr)
  175. if translate(word(chk,2))<>"IS" &  word(chk,2)<>"=" then do
  176.     call lineout,re_wh " Unable to find  address: " youraddr normal
  177.     say "    OWNER variable not assigned (but you can assign it later)"
  178.     ipaddr=" "
  179. end  /* Do */
  180. else do
  181.    if isnum then
  182.      ipaddr=word(chk,1)
  183.    else
  184.      ipaddr=word(chk,3)
  185.  
  186.    say " Your IP address: " ipaddr
  187. end
  188.  
  189. skip:
  190. nowdir=directory()
  191. adir=filespec("drive",nowdir)
  192. defname=adir||'\GOSERVE'
  193. defname2=adir||'\WWW'
  194.  
  195.  
  196. skip:
  197.  
  198. /* -------- Working directory (must exist ) */
  199. say
  200. call lineout, cy_ye " Please enter a few directory names: " normal
  201.  
  202. say " "
  203.  
  204. call lineout, bold  " What is GOSERVE's "working" directory? " normal
  205. say "    *  The SRE-FILTER program files will be written there. "
  206. say "    *  This does "bold"not"normal"  have to be the directory that contains GOSERVE.EXE"
  207.  
  208. n1:
  209. godir=get_dir(defname)
  210.  
  211. if godir=" " then godir=defname
  212. if godir="n.a." then signal n1
  213.  
  214. godir=strip(godir,'t','\')
  215. gsname=godir||"\GOSERVE.EXE"
  216.  
  217. call sysfiletree gsname,gname2,'F'
  218. if gname2.0=0 then do
  219.    say " Could not find GOSERVE.EXE in " godir "...."
  220.    if yesno(" Are you sure you want to use this directory?")=1 then signal useit0
  221.    if godir=defname then defname= "n.a."
  222.    signal n1
  223. end  /* Do */
  224.  
  225. useit0: workdir=godir
  226.  
  227. tdir=strip(godir,'t','\')||'\TEMP'
  228. oo=sysmkdir(tdir)              /* creating temporary directory */
  229.  
  230.  
  231. say " "
  232.  
  233. /* -- Get the DATA subdirectory of the working directory */
  234. say " "
  235. say  " Where should SRE-FILTER's Username, Access, Auditing, etc. files be installed?"
  236. say  "    .. it is recommended that it be under your working directory ! "
  237. sdatadir=get_dir(workdir||'\DATA')
  238.  
  239. /* -- Get the MESSAGE subdirectory of the working directory */
  240. say " "
  241. say  " Where should SRE-FILTER's Message Boxes  be stored?"
  242. say  "    .. it is recommended that it be under your working directory ! "
  243. mboxdir=get_dir(workdir||'\MESSAGE')
  244.  
  245. /* -- Get the Mail subdirectory of the working directory */
  246. say " "
  247. say  " Where should SRE-FILTER write & read e-mail from?"
  248. say  "    .. this should be the inbox of your SMTP server (if you are not"
  249. say  "       running an SMTP server, you can ignore this question)"
  250. mailboxdir=get_dir(workdir||'\MAIL')
  251.  
  252.  
  253. /* -- Get the configuration subdirectory of the working directory */
  254. say " "
  255. cfdir:
  256. say  " Where should SRE-FILTER's simple-mode configuration files be placed?"
  257. config_dir=get_dir(workdir||'\CONFIGS')
  258. if pos('\SREFCONF',upper(config_dir))>0 then do
  259.    say " You can not use the name SREFCONF (it confuses the server) "
  260.    signal cfdir
  261. end  /* Do */
  262.  
  263.  
  264. /* -- Get the UpLOAD subdirectory of the working directory */
  265. say " "
  266. say  " Where should SRE-FILTER store Uploaded files?"
  267. upload_dir=get_dir(workdir||'\upload')
  268.  
  269.  
  270. /* -- Get the CGI-BIN directory of the working directory */
  271. say " "
  272. say " Where should CGI-BIN files be stored? "
  273. cgibin_dir=get_dir(workdir||'\cgi-bin')
  274.  
  275.  
  276. /* -- Get the temporary files of the working directory */
  277. say " "
  278. say " What directory should SRE-Filter use for it's workspace? "
  279. tempdatadir=get_dir(workdir||'\temp')
  280.  
  281.  
  282.  
  283.  
  284. /* -- Get the data directory */
  285. say " "
  286. call lineout, cy_ye" + + + + "normal BOLD " What is your data directory ?" normal
  287. say  '    .. this is  the location of your "home page" document. '
  288.  
  289. datadir=get_dir(defname2)
  290.  
  291. /* -- Get the IMGS subdirectory of the data directory */
  292. say " "
  293.  
  294. say  " Where should SRE-FILTER's GIF files be installed?"
  295. say  "    .. it should be under your data directory ! "
  296.  
  297. gifdir=get_dir(datadir||'\IMGS')
  298.  
  299.  
  300. /* -- The "sample and help files" directory */
  301. say " "
  302.  
  303. say " Where should  the Sample and Help Files be installed?"
  304. say bold "         We HIGHLY recommend using the default " normal
  305. say      "         (SRE-Filter's documentation expects it)! "
  306.  
  307. helpdir=get_dir(datadir||'\SAMPLES',datadir)
  308.  
  309.  
  310. /* --  The "temporary directory" -- */
  311. say " "
  312.  
  313. say " What directory should "bold"SRE-Filter add-ons"normal" use for workspace? "
  314. say "     *   SRE-Filter will use " tempdatadir " for it's own workspace"
  315. say "     *   it's recommended, but not required, that this be under "
  316. say "         your data directory "
  317.  
  318.  
  319. tempdir=get_dir(datadir||'\TEMP')
  320.  
  321.  
  322.  
  323. eek=godir||'\srefiltr.*'
  324. call sysfiletree eek,gname3,'F'
  325. /* -- Done with directory creation -- copy files ... */
  326.  
  327. /* but first, backup? */
  328.  say " "
  329.  call lineout, re_wh "Are you re-installing/upgrading SRE-Filter:  " normal
  330.  call lineout, bold  "If you are ... "
  331.  foo=yesno(" ... would you like to archive the various user-configurable files")
  332.  if foo=1 then do
  333.       say  " Where should SRE-FILTER archive these files"
  334.       aa="\BK"||space(translate(date('o'),' ','/\'),0)
  335.       backup_dir=get_dir(workdir||aa)
  336.  
  337. /* files to backup*/
  338.       in_workdir=' SREFILTR.80 SREFQUIK.80 COUNTER.RXX   LOGFAIL.HTM ACCFAIL.HTM INITFILT.80 MEDIATYP.RXX '
  339.       in_workdir=in_workdir||'PREFILTR.80 POSTFILT.80 POSTRCRD.80 POSTMAIL.80 '
  340.       in_sdatadir=' ALL_FILE.CTL ALIASES.IN VIRTUAL.IN USERS.IN SENDFILE.CNT RECRDALL.CNT '
  341.       in_sdatadir=in_sdatadir||'COUNTER.CNT SREFLOGS.INI REPSTRGS.IN '
  342.       in_mboxdir='ANYONE.LOG '
  343.       in_datadir='INDEX.HTM'
  344.       call dobackup
  345.       say " Note: you might be asked to backup a few other files  "
  346.       say "       (for storage in their 'own' directory)"
  347.  end
  348.  else do
  349.     say " "
  350.  end  /* Do */
  351.  
  352. foo=yesno(" SRE-Filter will now be installed. Are you ready? ")
  353. if foo=0 then do
  354.   say " Try again later... "
  355.   exit
  356. end
  357.  
  358. say " "
  359. say " Copying dynamic link libraries .. "
  360. if gotrxlib=1 then do
  361.    say " Note: a copy of REXXLIB seems to be on your system "
  362. end  /* Do */
  363. foo=check_copy('REXXLIB.DLL',workdir)
  364. if dropunz=0 then do
  365.    say " Note: a copy of UNZIPAPI seems to be on your system "
  366. end  /* Do */
  367. foo=check_copy('UNZIPAPI.DLL',workdir)
  368. say " "
  369.  
  370. say " Copying  SRE-FILTER main and misc. program files files to " workdir
  371.  
  372. s1=workdir||'\SREFILTR.80'
  373. if stream(s1,'c','query exists')<>' ' then do
  374.   say bold "Warning: " normal " An old version of SREFILTR.80 has been detected"
  375.   s1a=dostempname(workdir||'\SREFILTR.B??')
  376.   ok=yesno(" Would you like to rename it to "|| s1a)
  377.   if ok=1 then do
  378.      foo=dosrename(s1,s1a)
  379.   end
  380.   say bold " Note:" normal "SREFILTR.80 contains several 'advanced user' parameters."
  381.   say "       If you've modified them, you will need to re-do the changes"
  382.   say "       after this installation is complete. "
  383.   say " "
  384. end
  385.  
  386. s1=workdir||'\SREFQUIK.80'
  387. if stream(s1,'c','query exists')<>' ' then do
  388.   say bold "Warning: " normal " An old version of SREFQUIK.80 has been detected"
  389.   s1a=dostempname(workdir||'\SREFQUIK.B??')
  390.   ok=yesno(" Would you like to rename it to "|| s1a)
  391.   if ok=1 then do
  392.      foo=dosrename(s1,s1a)
  393.   end
  394.   say bold " Note:" normal "SREFQUIK.80 contains a few 'advanced user' parameters."
  395.   say "       If you've modified them, you will need to re-do the changes"
  396.   say "       after this installation is complete. "
  397.   say " "
  398. end
  399.  
  400.  
  401. foo=check_copy('*.80' ,workdir,,1)
  402. foo=check_copy('SREFMON.CMD' ,workdir,,1)
  403. foo=check_copy('DO*.CMD' ,workdir,,1)
  404. foo=check_copy('FREEUP.CMD' ,workdir,,1)
  405. foo=check_copy('STATUS.CMD' ,workdir,,1)
  406. foo=check_copy('CONFIG2.CMD' ,workdir,,1)
  407. foo=check_copy('CONFCOLR.CMD' ,workdir,,1)
  408. foo=check_copy('SREFCONF.CMD' ,workdir,,1)
  409. foo=check_copy('ADV_OPTS.CMD' ,workdir,,1)
  410.  
  411. foo=check_copy('USERCFG.CMD',workdir,,1)
  412. foo=check_copy('ALIASCFG.CMD',workdir,,1)
  413. foo=check_copy('ACCESCFG.CMD',workdir,,1)
  414. foo=check_copy('HTACCFG.CMD',workdir,,1)
  415. foo=check_copy('VIRTCFG.CMD',workdir,,1)
  416.  
  417. foo=check_copy('TESTURL.CMD',workdir,,1)
  418.  
  419. if install_all=1 then do
  420.     foo=check_copy('LOGFAIL.HTM' ,workdir,' This is your "logon failure response file". Are you sure? ')
  421.     foo=check_copy('ACCFAIL.HTM' ,workdir,' This is your "access failure  response file". Are you sure?')
  422. end
  423.  
  424. foo=check_copy('CONFIGUR.HTM' ,datadir,,1)
  425. foo=check_copy('CONFCOLR.HTM' ,datadir,,1)
  426.  
  427. foo=check_copy('*.RXX',workdir,,1)
  428.  
  429. if install_all=1 then do
  430. say " "
  431.    say " Copying  user configurable parameter files to " workdir
  432.    foo=check_copy('*.IN', sdatadir,' *** THESE ARE PARAMETER & CONFIGURATION FILES : Are you sure?')
  433.    say " "
  434.    say " Copying configuration file, for the  common-log audit facility, to " workdir
  435.    foo=check_copy('SREFLOGS.INI', sdatadir,' *** This is the common-log configuration file: Are you sure?')
  436.    say " "
  437.    say " Copying access control and audit files to " sdatadir
  438.    foo=check_copy('ALL_FILE.CTL',sdatadir,'  This is your access control file: Are you sure?')
  439.    foo1=check_COPY('ADV_OPTS.CTL',sdatadir,,1)
  440.  
  441.    foo=check_COPY('*.CNT', sdatadir,' These are your "hit-counter" files: Are you sure?')
  442.  
  443.    say " "
  444.    say "Copying sample message box file to " mboxdir
  445.    foo=check_COPY('ANYONE.LOG', mboxdir,' This is your default "message box": Are you sure?')
  446.    say " "
  447.    say " Copying sample and help files to " helpdir
  448.    foo1=check_COPY('*.HTM',helpdir,,1)
  449.    foo1=check_COPY('*.SHT',helpdir,,1)
  450.    foo=check_COPY('*.DAT',helpdir,,foo1)
  451.    foo=checK_COPY('SAMPMAP.*',helpdir,,foo1)
  452.    foo=check_COPY('TESTTABL.TBL',HELPDIR,,foo1)
  453.    foo=check_COPY('TESTTABL.DEF',HELPDIR,,foo1)
  454. end
  455.  
  456. foo=check_copy('*.IDX',sdatadir,,1)
  457. foo=check_copy('*.RXL',workdir,,1)
  458.  
  459. say " Copying Sample CGI-Bin programs to " cgibin_dir
  460. foo1=check_copy('*.PL',cgibin_dir,,1)
  461. foo=check_copy('XCOUNT.CMD',cgibin_dir,,foo1)
  462. foo=check_copy('JCOUNT.CMD',cgibin_dir,,foo1)
  463. foo=check_copy('TEST-CGI.CMD',cgibin_dir,,foo1)
  464.  
  465.  
  466.  
  467.  
  468. foo=check_COPY('*.DOC',helpdir,,foo1)
  469. foo=check_COPY('*.FAQ',helpdir,,foo1)
  470. say " "
  471. SAY ' Copying GIF file archive to  ' gifdir
  472. foo=check_COPY('GIFS.ZIP',gifdir,,1)
  473. say " Copying simple mode configuration files to " config_dir
  474. foo=check_COPY('CONFIGS.ZIP',config_dir,,1)
  475.  
  476. if gotunz=0 then do
  477.    say " "
  478.     say bold " UZUNZIP.DLL could not be found " normal
  479.     say "          * you will need to unzip GIFS.ZIP (in " gifdir
  480.     say '          * you will need to unzip CONFIGS.ZIP (in ' config_dir
  481.     call charout , cy_ye ' (hit any key to continue) ' normal
  482.     foo=sysgetkey("noecho")
  483.  
  484.     signal nogotuz
  485. end  /* Do */
  486.  
  487. meis=directory()
  488. signal on error name foobar1
  489. signal on syntax name foobar1
  490. okuz=0
  491. gifis=directory(gifdir)
  492. rc=uzunzip(' -q -o GIFS.ZIP',foos)
  493.  
  494. agifis=directory(config_dir)
  495. rc=uzunzip(' -q -o CONFIGS.ZIP',foos)
  496. okuz=1
  497.  
  498. foobar1:
  499. signal off error ;signal off syntax
  500. if okuz=0 then do
  501.      say " "
  502.     say bold "WARNING: " normal
  503.     say " A problem with the UNZIP dll has occurred (can not find UZUNZIP). "
  504.     say " You can either: "
  505.     say "    a) ^C, shutdown, and try again (that seems to work) "
  506.     say "    b) Complete the installation, and then from an OS/2 prompt: "
  507.     say "        i) UNZIP GIFS.ZIP (in " gifdir
  508.     say "        ii) UNZIP CONFIGS.ZIP (in " config_dir
  509.     say " I know this is a tedious solution, but it is a very flakey problem!"
  510.     call charout , cy_ye ' (hit any key to continue) ' normal
  511.     foo=sysgetkey("noecho")
  512. end  /* Do */
  513.  
  514. meis=directory(meis)
  515.  
  516. nogotuz:  nop
  517.  
  518. IF INSTALL_ALL=0 then SIGNAL DONE1A
  519.  
  520. /* --- customize index.htm  -- */
  521. say " "
  522. call lineout, cy_ye  " ... customizing files ... " normal
  523. say " "
  524. say ' Copying sample home page to ' datadir
  525. thefh=grab_file("INDEX.HT0")
  526. if thefh=0 then do
  527.    Say " ERROR : Could not find sample home page "
  528.    say "         You may need to unzip SREFILTR.ZIP  again? "
  529.    signal done1
  530. end
  531. parse var helpdir foo (datadir) thesamp
  532. thesamp=strip(translate(thesamp,'/','\'),,'/')
  533. thefh=replacestrg(thefh,'helpdirectory',thesamp,'ALL')
  534. dog=datadir||'\INDEX.HTM'
  535.  
  536. drop foo1
  537. tmp=sysfiletree(dog,foo1,'F')
  538. ok=1
  539. if foo1.0>0 & copyall=0 then
  540.   ok=yesno(" Overwrite "||dog"?")
  541.  
  542. if ok=1 then do
  543.   if foo1.0>0 then do 
  544.     toydog=dostempname(datadir||'\INDEX.???')
  545.     foo=dosrename(dog,toydog)
  546.     say bold " Note: "normal " just to be safe, your old INDEX.HTM has been "
  547.     say      "       moved to " toydog
  548.     call syssleep(2)
  549.   end
  550.   aa=stream(dog,'c','open write')
  551.   if aa<>'READY:' then do
  552.     say " ERROR: could not write " dog
  553.     signal done1
  554.   end
  555.   foo=charout(dog,thefh)
  556.   if foo>0 then do
  557.      say " ERROR: Problem writing " dog
  558.      signal done1
  559.   end
  560.   aa=stream(dog,'c','close')
  561.   useindex='INDEX.HTM'
  562. end
  563. else do
  564.    dog2=dostempname(datadir||'\SINDX???.HTM')
  565.    foo=charout(dog2,thefh)
  566.    if foo=0 then do
  567.      say bold " Note: "normal " A sample SRE-Filter home page has been"
  568.      say "    copied to " dog2
  569.      say "It contains links to several useful configuration tools, "
  570.      say " as well as links to SRE-Filter demos."
  571.      call syssleep(4)
  572.      useindex=filespec('n',dog2)
  573.    end
  574. end
  575.  
  576. /* --- customize mediatyp.rxx -- */
  577. say " "
  578. say ' Copying the user defined MIME type file (MEDIATYP.RXX) to ' workdir
  579. thefh=grab_file("MEDIATYP.RX0")
  580. if thefh=0 then do
  581.    Say " ERROR : Could not find user-defined MEDIATYPE file"
  582.    say "         You may need to unzip SREFILTR.ZIP  again? "
  583.    signal done1
  584. end
  585. dog=workdir||'\MEDIATYP.RXX'
  586.  
  587. drop foo1
  588. tmp=sysfiletree(dog,foo1,'F')
  589. ok=1
  590. if foo1.0>0 & copyall=0 then do
  591.   say " Overwrite " dog " -- your customized MIME types list? "
  592.   ok=yesno(" Overwrite "||dog"?")
  593. end
  594. if ok=1 then do
  595.   foo=sysfiledelete(dog)          /* delete any prior version */
  596.   aa=stream(dog,'c','open write')
  597.   if aa<>'READY:' then do
  598.     say " ERROR: could not write " dog
  599.     signal done1
  600.   end
  601.   foo=charout(dog,thefh)
  602.   if foo>0 then do
  603.      say " ERROR: Problem writing " dog
  604.      signal done1
  605.   end
  606.   aa=stream(dog,'c','close')
  607. end
  608.  
  609.  
  610. /*-- Customize CONFIGx.HTM --- */
  611.  
  612. say " Modifying simple SRE-FILTER configurator (CONFIG0.HTM) "
  613. thefh=grab_file("CONFIG0.HT0")
  614. if thefh=0 then do
  615.    Say " ERROR : Could not find CONFIG0 configurator program. "
  616.    say "         You may need to unzip SREFILTR.ZIP  again? "
  617.    signal done1
  618. end
  619. thefh=replacestrg(thefh,'helpdirectory',thesamp,'ALL')
  620. dog=datadir||'\CONFIG0.HTM'
  621.  
  622. drop foo1
  623. tmp=sysfiletree(dog,foo1,'F')
  624. ok=1
  625. if ok=1 then do
  626.   foo=sysfiledelete(dog)          /* delete any prior version */
  627.   aa=stream(dog,'c','open write')
  628.   if aa<>'READY:' then do
  629.      say " ERROR: could not write " dog
  630.      signal done1
  631.   end
  632.   foo=charout(dog,thefh)
  633.   if foo>0 then do
  634.      say " ERROR: Problem writing " dog
  635.      signal done1
  636.   end
  637.   aa=stream(dog,'c','close')
  638.   say "  "
  639. end
  640.  
  641.  
  642. /*-- Customize CONFIG2.HTM --- */
  643. say " Modifying Intermediate SRE-FILTER configurator (CONFIG2.HTM) "
  644. thefh=grab_file("CONFIG2.HT0")
  645. if thefh=0 then do
  646.    Say " ERROR : Could not find CONFIG2 configurator program. "
  647.    say "         You may need to unzip SREFILTR.ZIP  again? "
  648.    signal done1
  649. end
  650. thefh=replacestrg(thefh,'helpdirectory',thesamp,'ALL')
  651. dog=datadir||'\CONFIG2.HTM'
  652.  
  653. drop foo1
  654. tmp=sysfiletree(dog,foo1,'F')
  655. ok=1
  656. if ok=1 then do
  657.   foo=sysfiledelete(dog)          /* delete any prior version */
  658.   aa=stream(dog,'c','open write')
  659.   if aa<>'READY:' then do
  660.      say " ERROR: could not write " dog
  661.      signal done1
  662.   end
  663.   foo=charout(dog,thefh)
  664.   if foo>0 then do
  665.      say " ERROR: Problem writing " dog
  666.      signal done1
  667.   end
  668.   aa=stream(dog,'c','close')
  669.   say "  "
  670. end
  671.  
  672.  
  673.  
  674. /*-- Customize CONFIG3.HTM --- */
  675. say " Modifying expert SRE-FILTER configurator (CONFIG3.HTM) "
  676. thefh=grab_file("CONFIG3.HT0")
  677. if thefh=0 then do
  678.    Say " ERROR : Could not find CONFIGUR configurator program. "
  679.    say "         You may need to unzip SREFILTR.ZIP  again? "
  680.    signal done1
  681. end
  682. thefh=replacestrg(thefh,'helpdirectory',thesamp,'ALL')
  683. dog=datadir||'\CONFIG3.HTM'
  684.  
  685. drop foo1
  686. tmp=sysfiletree(dog,foo1,'F')
  687. ok=1
  688. if ok=1 then do
  689.   foo=sysfiledelete(dog)          /* delete any prior version */
  690.   aa=stream(dog,'c','open write')
  691.   if aa<>'READY:' then do
  692.      say " ERROR: could not write " dog
  693.      signal done1
  694.   end
  695.   foo=charout(dog,thefh)
  696.   if foo>0 then do
  697.      say " ERROR: Problem writing " dog
  698.      signal done1
  699.   end
  700.   aa=stream(dog,'c','close')
  701.   say "  "
  702. end
  703.  
  704.  
  705.  
  706. /*-- Modifying the INITFILT.80 file -- */
  707.  
  708. say " "
  709.  
  710. say " Modifying the INITFILT.80 parameters file "
  711. thefh=grab_file("INITFILT.A80")
  712. if thefh=0 then do
  713.    Say " ERROR : Could not find  INITFILT.A80 parameters file. "
  714.    say "         You may need to unzip SREFILTR.ZIP  again? "
  715.    signal done1
  716. end
  717.  
  718. thefh=replacestrg(thefh,'workingdirectory',workdir,'ALL')
  719. thefh=replacestrg(thefh,'workingdir',workdir,'ALL')
  720.  
  721. thefh=replacestrg(thefh,'messageboxdir',mboxdir,'ALL')
  722.  
  723. thefh=replacestrg(thefh,'mailboxdir',mailboxdir,'ALL')
  724.  
  725. thefh=replacestrg(thefh,'workingdatadir',sdatadir,'ALL')
  726. thefh=replacestrg(thefh,'temporarydir',tempdir,'ALL')
  727. thefh=replacestrg(thefh,'tempdatadir',tempdatadir,'ALL')
  728. thefh=replacestrg(thefh,'owneraddress',ipaddr,'ALL')
  729. thefh=replacestrg(thefh,'uploaddir',upload_dir,'ALL')
  730. thefh=replacestrg(thefh,'cgibindirectory',cgibin_dir,'ALL')
  731. thefh=replacestrg(thefh,'configuredir',config_dir,'ALL')
  732.  
  733.  
  734. /* Set some  "common parameters" */
  735. uu=set_params(0)
  736. thefh=replacestrg(thefh,'aautoname',aautoname,'ALL')
  737. thefh=replacestrg(thefh,'adefault',adefault,'ALL')
  738. thefh=replacestrg(thefh,'assishtml',assi,'ALL')
  739. thefh=replacestrg(thefh,'ahomename',ahomename,'ALL')
  740. thefh=replacestrg(thefh,'arealm',arealm,'ALL')
  741. thefh=replacestrg(thefh,'awebmaster',awebmaster,'ALL')
  742. thefh=replacestrg(thefh,'assicache',assicache,'ALL')
  743. thefh=replacestrg(thefh,'ahomedir',ahomedir,'ALL')
  744.  
  745. dog=workdir||'\INITFILT.80'
  746. initfilt_File=dog
  747. drop foo1
  748. tmp=sysfiletree(dog,foo1,'F')
  749. ok=1
  750. if foo1.0>0  & copyall=0 then do
  751.   ok=yesno(" Overwrite "||dog"?")
  752.   if ok=1 then do
  753.       say dog " is your SRE-Filter configuration file... "
  754.       ok=yesno("        are you sure you want to overwrite it?")
  755.   end
  756. end
  757.  
  758. if ok=1 then do
  759.   dog2=dostempname(workdir||'\INITFILT.B??')
  760.   foo=dosrename(dog,dog2)
  761.   say bold "Note: " normal " The old INITFILT.80 file has been moved to " dog2
  762.   foo=sysfiledelete(dog)          /* delete any prior version */
  763.   aa=stream(dog,'c','open write')
  764.   if aa<>'READY:' then do
  765.      say " ERROR: could not write " dog
  766.      signal done1
  767.   end
  768.   foo=charout(dog,thefh)
  769.   if foo>0 then do
  770.      say " ERROR: Problem writing " dog
  771.      signal done1
  772.   end
  773.   aa=stream(dog,'c','close')
  774. end
  775.  
  776. /* -- add entry to users.in file */
  777. foo=add_user(sdatadir)
  778.  
  779.  
  780. /*--Deleting old .80 files */
  781.  
  782. say " "
  783. list80='dosearch.80 status.80 srchindx.80'
  784. do mm=1 to words(list80)
  785.    a1=word(list80,mm)
  786.    dog=godir||'\'||a1
  787.    tmp=sysfiletree(dog,foo1,'F')
  788.    if foo1.0>0 then do
  789.      ok=yesno(" Delete old (support) file: "||dog"?")
  790.      if ok=1 then
  791.         foo=sysfiledelete(dog)          /* delete any prior version */
  792.   end /* do */
  793. end
  794.  
  795.  
  796. done1: nop
  797.  
  798. call charout , cy_ye ' (hit any key to continue) ' normal
  799. foo=sysgetkey("noecho")
  800.  
  801. done1A: nop
  802.  
  803. a=scrclear()
  804.  
  805. call lineout, bold cy_ye  " SRE-FILTER has been installed... " normal
  806. say " "
  807. say ' '
  808. say ' Your web site is now ready to be built!  '
  809. say '      (just add documents, images, links, etc...)'
  810. say ' '
  811. say ' Notes:'
  812. say '    * 'useindex ', the sample SRE-Filter home page, contains a number of '
  813. say '      useful links to configuration tools, demos, and on-line documentation.'
  814. say "      It's located in your GoServe data directory ("datadir")"
  815. say '    * If you use a  different File name as your "home page",'
  816. say "      be sure to change SRE-FILTER's " bold "DEFAULT " normal " initialization parameter."
  817. say ' '
  818. signal on syntax name gogo
  819. signal on error name gogo
  820. gonotes:
  821. say " "
  822. say bold " Would you like to read some additional configuration hints? "normal
  823. say " "bold"1"normal") Setting up GoServe "
  824. say " "bold"2"normal") Configuring SRE-Filter "
  825. say " "bold"3"normal") Finding Help on SRE-Filter "
  826. say " "bold"4"normal") A note on ports "
  827. say " "bold"5"normal") A note on SRE-Filter add-ons "
  828. say " "bold"6"normal") Notes for Upgraders  -- and an INITFILT.80 comparator!"
  829. say " "bold"7"normal") Cleaning up and removing SRE-Filter "
  830. say " "bold"8"normal") View SRE-Filter status information"
  831.  
  832. say " "bold"X"normal") Exit installation program ."
  833. gonotes2:
  834. call charout, reverse " Select an option from the above: " normal
  835. pull anopt
  836.  
  837. select
  838.    when  anopt="1" then signal note1
  839.    when  anopt="2" then signal note2
  840.    when  anopt="3" then signal note3
  841.    when  anopt="4" then signal note4
  842.    when  anopt="5" then signal note5
  843.    when  anopt="6" then signal note6
  844.    when  anopt="7" then signal note7
  845.    when  anopt="8" then signal note8
  846.  
  847.  
  848.    when  anopt="X" then do
  849.       if dropunz=1 then foo=zdropfunc()
  850.       if droprxlib=1 then foo=rexxlibderegister()
  851.       say " bye .. "
  852.       exit
  853.    end
  854.    otherwise
  855.         signal gonotes2
  856. end  /* select */
  857.  
  858. gogo:
  859. signal  off syntax
  860.  
  861.  
  862. exit
  863.  
  864. note1: nop
  865. say cy_ye " -----  Configuring GoServe:" normal
  866. say " 1) Instruct GoServe that SREFILTR.80 is the working filter. To do this: "
  867. say '     enter ' bold 'http filter srefiltr.80' normal ' in the'
  868. say "  " bold " optional parameters line " normal " in GoServe's settings window,"
  869. say "     (right-mouse click on the GoServe icon ...) "
  870. say bold " Option:" normal " You might want to use SREFQUIK.80 instead of SREFILTR.80.  "
  871. say "        (see the documentation for a discussion of these two variants)."
  872. say " 2) Make sure that GoServe knows your data directory "
  873. say "     (use the OPTIONS-DataDir tab in the GoServe status window) "
  874.  
  875.  
  876. call charout , cy_ye ' (hit any key to continue) ' normal
  877. foo=sysgetkey("noecho")
  878. a= scrclear()
  879. signal gonotes
  880.  
  881.  
  882.  
  883.  
  884. note2:
  885. say cy_ye " -----  Configuring SRE-Filter:" normal
  886.  
  887. if thishost="" then thishost=get_hostname()
  888. say ' To further configure SRE-FILTER, you can run CONFIGUR.HTM '
  889. say " (actually, you should probably read the documentation first!) "
  890. say "  "
  891. say " To do this: "
  892. say "   a) Fire up your favorite web browser"
  893. say '   b) Point it a http://'thishost'/CONFIGUR.HTM'
  894. say '      (Note: you can also use /CONFIGURE, which is "aliased" to CONFIGUR.HTM)'
  895. say '   c) You can then choose one of three configuration modes:'
  896. say '      i) Simple mode: A well-documented, form based tool for modifying '
  897. say '         the more important SRE-Filter parameters'
  898. say '     ii) Intermediate mode: A less well-documented, but more powerful, '
  899. say '         form based tool for modifying almost all of the parameters '
  900. say '    iii) Expert mode: Edit the various text files containing the '
  901. say '           the parameters'
  902. say 'Note that 'bold'parameters'normal' include:'
  903. say '  usernames, redirection aliases, SEL-specific access controls, '
  904. say '  virtual directories, and HTACCESS files.'
  905. say '   '
  906. call charout , cy_ye ' (hit any key to continue) ' normal
  907. foo=sysgetkey("noecho")
  908.  
  909. say bold " A Note on Security: " normal
  910. say "   SRE-Filter checks for SUPERUSER privileges before allowing access to "
  911. say "   the configurator.  Note that the OWNER address (that you entered at the  "
  912. say "   beginning of this installation), and the user you (may) have added"
  913. say "   are both granted SUPERUSER status. "
  914. say " "
  915. say "  If you are "bold"very security conscious"normal", you can limit "
  916. say "  configuration to requests issued from the server itself. "
  917. say "  See SREFCONF.CMD, CONFIG2.CMD, and the  various *CFG.CMD files "
  918. say "  (located in " workdir ") for details."
  919. call charout , cy_ye ' (hit any key to continue) ' normal
  920. foo=sysgetkey("noecho")
  921. a= scrclear()
  922. signal gonotes
  923.  
  924.  
  925.  
  926. note3:
  927. say cy_ye " -----  Finding Help on SRE-Filter:" normal
  928. say ' SRE-Filter comes with numerous help documents (you can find them '
  929. say ' in ' helpdir ')'
  930. say ' '
  931. say ' The following are the more important help documents: '
  932. say '   * INTRO.DOC    -- a 1 page description of SRE-Filter'
  933. say '   * GUIDE.HTM    -- the Users Guide  ' bold ' -- A good place to start ' normal
  934. say '   * SREFILTR.HTM -- the SRE-Filter manual'
  935. say '   * SREFILTR.FAQ -- some frequently asked questions '
  936. say "   * INITFILT.DOC -- a detailed description of SRE-FILTER's initialization"
  937. say '                     parameters, with possible choices described for each. '
  938. say '   * SREFQUIK.DOC -- a discussion of SREFQUIK -- a potentially faster variant '
  939. say '                     of SRE-Filter (requires additional configuration) '
  940. say '   * SUMMARY.HTM  -- a summary of SRE-FILTER '
  941. say '   * CHANGES.DOC  -- history of changes '
  942. say '   * OUTLINE.HTM  -- a technical outline of how SRE-Filter processes a request'
  943. say '   * HELPLIST.HTM  -- a list of the SRE-Filter help documents. '
  944. say ' '
  945. say " Hint: the users guide is a good place to start (there's a link to it"
  946. say '       on the SRE-Filter sample home page) '
  947. say ' '
  948. say " For tough problems, you can contact DANIELH@ECON.AG.GOV "
  949. say " "
  950. call charout , cy_ye ' (hit any key to continue) ' normal
  951. foo=sysgetkey("noecho")
  952. a= scrclear()
  953. signal gonotes
  954.  
  955. note4:
  956. say cy_ye " -----  A Note on Ports:" normal
  957. say '  If you can not use port 80, all you need to do is '
  958. say '  change all the *.80 files (to *.new_port_number) -- see the '
  959. say '  documentation for details '
  960. call charout , cy_ye ' (hit any key to continue) ' normal
  961. foo=sysgetkey("noecho")
  962. a= scrclear()
  963. signal gonotes
  964.  
  965. note5:
  966. say cy_ye " -----  A Note on SRE-Filter add-ons:" normal
  967. say ' SRE-Filter has a number of add-ons avaiable. You can download them '
  968. say ' from the http://rpbbcam.econ.ag.gov/srefilter site.  '
  969. say ' For examle, you may be interested in: '
  970. say '   'bold'SRCHINDX:'normal' A directory-indexer/search-engine '
  971. say '   'bold'FORUM:'normal' A  "news-group and list-server" discussion-group package '
  972. say '   'bold'BBS:'normal' A full featured "web based bulletin board system" '
  973. say '   'bold'GETAFILE:'normal' A  directory displayer, with user-settable display features'
  974. say '   'bold'CALC:'normal' A character-mode scientific calculator with a web interface '
  975. say '   'bold'SREFPRC1:'normal' The source code for the SRE-Filter macrospace routines '
  976. say ' '
  977. call charout , cy_ye ' (hit any key to continue) ' normal
  978. foo=sysgetkey("noecho")
  979. a= scrclear()
  980. signal gonotes
  981.  
  982.  
  983. /* */
  984.  
  985. note6: nop
  986. say cy_ye " -----  Notes for Upgraders:" normal
  987. say " The major changes, from version 1.2g, are: "
  988. say "  1) The configurator has been overhauled. You can now view & modify "
  989. say "     SRE-Filter's more important options using "bold"well-documented"normal" option- "
  990. say "     specific forms (see CONFIG0.HTM for details)"
  991. say "     You can now change the background colors used by the configurator."
  992. say "  2) "reverse"Partially compiled versions"normal" of HTML documents (that contain server "
  993. say "     side includes) can now be cached. This can greatly improve response"
  994. say "     time (see SSICACHE.HTM for details). "
  995. say "  3) The built-in directory display facility has been re-built.  It caches "
  996. say "     to improve throughput, is easier to invoke, and contains an "
  997. say "    "bold" auto-description "normal"feature (see DIR.DOC for details)."
  998. say "  4) CGI-BIN scripts written in PERL can now be run under SRE-Filter "
  999. say "     (requires a PERL interpreter -- see PERL.DOC for details). "
  1000. say "  5) The ~ home-directory can now point to a subdirectory of each "reverse"user"normal
  1001. say "  6) Several facilities that  were packaged with SRE-Filter (such as FORUM"
  1002. say "     and GETAFILE) are now available as add-ons."
  1003. say "  7)  We " bold"recommend"normal" adding the following lines to your ALIASES.IN file: "
  1004. say "        DIR/*  DIR?/* "
  1005. say "        CONFIGURE /CONFIGUR.HTM  "
  1006. say "  9)  Support for common-log, browser-log, and referer-log audit files."
  1007. say " 10)  The documentation was extensively revised and more carefully edited."
  1008. say " "
  1009. say ' You can read CHANGES.DOC for a complete list of recent changes to SRE-Filter. '
  1010.  
  1011. call charout , cy_ye ' (hit any key to continue) ' normal
  1012. foo=sysgetkey("noecho")
  1013.  
  1014.  
  1015. say " "
  1016. say " "
  1017. say  cy_ye ' Scan your initialization file? ' normal
  1018. say " If you did "bold"not"normal" update the INITFILT.80 file, there may be parameters "
  1019. say " that you'll need to add (or remove) by hand. "
  1020. say " To facilitate this process, you can search for all required parameters "
  1021. say " that are missing from the "bold"currently active initialization file"normal
  1022. say " It will also find incorrect (and obsolete) parameters."
  1023. say " "
  1024.  
  1025. say " Note: the "bold"currently active initialization file"normal" is: " initfilt_file
  1026. say " "
  1027. ok=yesno(" Would you like to view these differences?")
  1028.  
  1029. if ok=1 then do
  1030.   a=fileread('initfilt.a80',newl,,'E')
  1031.   if newl.0=0 then do
  1032.     say "ERROR: Default INITFILT.80 file not found "
  1033.     exit
  1034.   end
  1035.   n1=0
  1036.   do nn=1 to newl.0
  1037.     aline=strip(newl.nn)
  1038.     if aline=' ' | abbrev(aline,';')=1 then iterate
  1039.     n1=n1+1
  1040.     parse var aline  atmp '=' news.n1.!stuff
  1041.     parse upper var atmp news.n1 '.' . ; news.n1=strip(news.n1)
  1042.   end /* do */
  1043.   news.0=n1
  1044.  
  1045.   do forever
  1046.     aa=initfilt_file
  1047.     if aa<>' ' then  aa=stream(aa,'c','query exists')
  1048.     if aa<>' ' then leave
  1049.     say  bold 'Could not find the old INITFILT.80 file ('initfilt_file')' normal
  1050.     say " Please enter it's (fully qualified) name: "
  1051.     parse pull initfilt_file
  1052.   end
  1053.  
  1054.   a=fileread(initfilt_file,oldl,,'E')
  1055.   n2=0
  1056.   do nn=1 to oldl.0
  1057.      aline=strip(oldl.nn)
  1058.      if aline=' ' | abbrev(aline,';')=1 then iterate
  1059.      n2=n2+1
  1060.      parse var aline  atmp '=' olds.n2.!stuff
  1061.      parse upper var atmp  olds.n2 '.' . ;olds.n2=strip(olds.n2)
  1062.   end /* do */
  1063.   olds.0=n2
  1064.  
  1065.   Say " Looking for required parameters: "
  1066.  
  1067.   do iu=1 to news.0
  1068.      lookfor=strip(news.iu)
  1069.      okay=0
  1070.      do iu2=1 to olds.0
  1071.       if olds.iu2=lookfor then  do
  1072.         iterate iu
  1073.       end
  1074.     end /* do */
  1075. /* if here, could not find */
  1076.     parse var news.iu.!stuff goob '/*' .
  1077.  
  1078.  
  1079.      thefh=replacestrg(goob,'messageboxdir',mboxdir,'ALL')
  1080.      thefh=replacestrg(thefh,'mailboxdir',mailboxdir,'ALL')
  1081.      thefh=replacestrg(thefh,'workingdatadir',sdatadir,'ALL')
  1082.      thefh=replacestrg(thefh,'temporarydir',tempdir,'ALL')
  1083.      thefh=replacestrg(thefh,'tempdatadir',tempdatadir,'ALL')
  1084.  
  1085.      thefh=replacestrg(thefh,'uploaddir',upload_dir,'ALL')
  1086.      thefh=replacestrg(thefh,'cgibindirectory',cgibin_dir,'ALL')
  1087.      thefh=replacestrg(thefh,'aautoname',aautoname,'ALL')
  1088.     thefh =replacestrg(thefh,'adefault',adefault,'ALL')
  1089.     thefh=replacestrg(thefh,'assishtml',assi,'ALL')
  1090.     thefh=replacestrg(thefh,'ahomename',ahomename,'ALL')
  1091.     thefh=replacestrg(thefh,'arealm',arealm,'ALL')
  1092.     thefh=replacestrg(thefh,'awebmaster',awebmaster,'ALL')
  1093.    thefh=replacestrg(thefh,'assicache',assicache,'ALL')
  1094.    thefh=replacestrg(thefh,'ahomedir',ahomedir,'ALL')
  1095.  
  1096.      goob=replacestrg(thefh,'configuredir',config_dir,'ALL')
  1097.  
  1098.     say '    Could not find ' lookfor '(recommended value= 'goob
  1099.   end /* do */
  1100.  
  1101.     call charout,  cy_ye ' (hit any key to continue) ' normal
  1102.   foo=sysgetkey("noecho")
  1103.   say " "
  1104.  
  1105.   say " ------------- "
  1106.   Say " Looking for incorrect and obsolete parameters "
  1107.   do iu=1 to olds.0
  1108.     lookfor=strip(olds.iu)
  1109.     okay=0
  1110.     do iu2=1 to news.0
  1111.        if news.iu2=lookfor then  do
  1112.          iterate iu
  1113.        end
  1114.     end /* do */
  1115. /* if here, could not find */
  1116.     parse var olds.iu.!stuff goob '/*' .
  1117.     say '    Unused variable: ' lookfor '= ' goob
  1118.   end /* do */
  1119. say " ------------- "
  1120. say " "
  1121. say " Hint: open up a text editor in another OS/2 window, and edit "
  1122.   say   initfilt_file " (while keeping this INSTALL window open). Make the "
  1123.   say " changes, and then reselect the " reverse " notes and hints for upgraders " normal " option "
  1124.  
  1125.  
  1126.   call charout , cy_ye ' (hit any key to continue) ' normal
  1127.   foo=sysgetkey("noecho")
  1128.   say " "
  1129. end
  1130.  
  1131. a= scrclear()
  1132. signal gonotes
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138. /* */
  1139.  
  1140. note7: nop
  1141. say cy_ye " -----  Cleaning up and Removing SRE-Filter:" normal
  1142. say " After you have finished installing SRE-Filter, you can delete the contents"
  1143. say " of the temporary directory (" directory() "). "
  1144. say bold " *** "normal" You may be told that "bold"a process is locked .."normal
  1145. say " This refers to the DLL's used in the install process. At your convenience, "
  1146. say " you should  reboot, and then delete, to complete this cleanup process "
  1147. say " (sorry, but I don't want to bother using OS/2 locked files facility)"
  1148. say " "
  1149. say " To remove SRE-Filter, just delete the contents of:"
  1150. say "    " bold "*" normal " the GoServe working directory:"  reverse workdir normal
  1151. say "      before you do this, you may first want to back up the GOSERVE.* "
  1152. say "      (and MAKEICON.CMD) files in the " reverse workdir normal
  1153. say " and you may want to clean up the:"
  1154. say "    " bold "*" normal "  GoServe data directory:" reverse datadir normal
  1155.  
  1156.  
  1157. call charout , cy_ye ' (hit any key to continue) ' normal
  1158. foo=sysgetkey("noecho")
  1159. say " "
  1160.  
  1161. a= scrclear()
  1162. signal gonotes
  1163.  
  1164. note8: nop
  1165. say cy_ye " -----  SRE-Filter Status Information" normal
  1166. say " If you want to keep an eye on what's happening on your web-server "
  1167. say " we recommend obtaining the PMPRINTF facility. You can download it from:"
  1168. say "     http://www2.hursley.ibm.com/goserve/pmprtf.zip"
  1169. say " PMPRINTF will open a window within which status information will be shown, "
  1170. say " with optional save-to-file features."
  1171. say " "
  1172. say " We especially recommend the use of PMPRINTF if you intend to "
  1173. say " monkey with the innards of SRE-Filter, or if you take a crack at writing "
  1174. say " your own add-ons -- it's really the only way to find out where the bugs are! "
  1175. say " "
  1176. say " You can also set SRE-Filter's VERBOSE variable to set the amount of "
  1177. say " information SRE-Filter displays (0 means very little, 4 means too much)."
  1178. say " "
  1179. say " You can also use  GOSERVE's AUDIT facility to record information (see "
  1180. say " GOSERVE.DOC for details)."
  1181. say " "
  1182.  
  1183.  
  1184. call charout , cy_ye ' (hit any key to continue) ' normal
  1185. foo=sysgetkey("noecho")
  1186. say " "
  1187.  
  1188. a= scrclear()
  1189. signal gonotes
  1190.  
  1191. exit
  1192.  
  1193.  
  1194.  
  1195. /********/
  1196. /* copy files to backup directory  */
  1197. dobackup:
  1198.  
  1199. do mm=1 to words(in_workdir)
  1200.      a1=strip(word(in_workdir,mm))
  1201.  
  1202.      cto=backup_dir||'\'||a1
  1203.      cfrom=workdir||'\'||a1
  1204.      if stream(cfrom,'c','query exists')<>"" then do
  1205.          call lineout,' Archiving ' cfrom ' ... '
  1206.          'COPY 'cfrom ' ' cto ' > nul '
  1207.      end  /* Do */
  1208.  
  1209. end /* do */
  1210. do mm=1 to words(in_sdatadir)
  1211.      a1=strip(word(in_sdatadir,mm))
  1212.      cto=backup_dir||'\'||a1
  1213.      cfrom=sdatadir||'\'||a1
  1214.      if stream(cfrom,'c','query exists')<>"" then do
  1215.          call lineout,' Archiving ' cfrom ' ... '
  1216.          'COPY 'cfrom ' ' cto  ' > nul '
  1217.      end
  1218. end /* do */
  1219. do mm=1 to words(in_mboxdir)
  1220.      a1=strip(word(in_mboxdir,mm))
  1221.      cto=backup_dir||'\'||a1
  1222.      cfrom=mboxdir||'\'||a1
  1223.      if stream(cfrom,'c','query exists')<>"" then do
  1224.          call lineout,' Archiving ' cfrom ' ... '
  1225.          'COPY 'cfrom ' ' cto  ' >nul'
  1226.      end  /* Do */
  1227. end
  1228.  
  1229. do mm=1 to words(in_datadir)
  1230.      a1=strip(word(in_datadir,mm))
  1231.      cto=backup_dir||'\'||a1
  1232.      cfrom=datadir||'\'||a1
  1233.      if stream(cfrom,'c','query exists')<>"" then do
  1234.          call lineout,' Copying ' cfrom ' ... '
  1235.          'COPY 'cfrom ' ' cto  ' > nul '
  1236.      end
  1237. end /* do */
  1238.  
  1239.  
  1240. return 0
  1241.  
  1242.  
  1243.  
  1244.  
  1245. /*****************/
  1246. /* Add an entry to the users.in file */
  1247. add_user:procedure expose ipaddr expose reverse bold normal re_wh cy_ye aesc
  1248.  
  1249. parse arg sdatadir
  1250.  
  1251. say " "
  1252. say  bold " Add a SUPERUSER to the UserName database " normal
  1253. say " "
  1254. say " To facilitate remote configuration, we recommend that you add a "
  1255. say " user, with SUPERUSER privileges, to the SRE-Filter UserName database."
  1256.  
  1257. ok=yesno(' Would you like add a SUPERUSER ')
  1258. say " "
  1259. if ok=0 then do
  1260.  
  1261.     say ' Note: To run the SRE-Filter configurator, you will need to use a  '
  1262.     say '      browser on the computer with the OWNERS (' ipaddr ")IP address."
  1263.     return 0
  1264. end
  1265.  
  1266. bugs: nop
  1267.  call charout, bold " Enter a username: " normal
  1268.  uname=stringin(,23," ",80)
  1269.  say " "
  1270.  
  1271.  call charout, bold " Enter a password: " normal
  1272.  pwd=stringin(,23," ",80)
  1273.  say " "
  1274.  
  1275. if uname="" | pwd="" then do
  1276.     say " missing username or password: please reenter "
  1277.     signal bugs
  1278. end  /* Do */
  1279.  
  1280.  
  1281. /* read users.in, append uname pwd , write it*/
  1282. afile=strip(sdatadir,'t','\')||'\USERS.IN'
  1283. foo=fileread(afile,inl,,'E')
  1284. oof=uname' 'pwd' SUPERUSER '
  1285. ii=inl.0+1
  1286. inl.ii=oof
  1287. inl.0=ii
  1288. foo=filewrite(afile,inl,'R')
  1289. if foo=0 then do
  1290.    say " Error: could not modify usernames database file: " afile
  1291. end
  1292. else do
  1293.    say " If the configurator asks for a username & password, you can use"
  1294.    say bold uname normal " for the username, and " bold pwd normal " for the password "
  1295. end
  1296. return 1
  1297.  
  1298.  
  1299.  
  1300. /* ----------------------------------------------------------------------- */
  1301. /* HOST -- return the result of a HOST command  (a ping )                  */
  1302. /* ----------------------------------------------------------------------- */
  1303. /* This need not be in the main filter program                             */
  1304. /* It returns the GoServe command to send back the result                  */
  1305.   host: procedure
  1306.    parse arg eek
  1307.     do queued(); pull .; end                   /* flush */
  1308.     address cmd '@host' eek '| rxqueue'     /* execute the command */
  1309.     parse pull hostresult                      /* get result */
  1310.     return hostresult
  1311. /*
  1312.     crlf='0d0a'x
  1313.     return 'STRING host' arg(1)':'crlf crlf''hostresult
  1314. */
  1315.  
  1316. /* -------------------- */
  1317. /* get a yes or no , return 1 if yes */
  1318. yesno0:procedure expose normal reverse bold
  1319. parse arg fooa , allopt
  1320. ayn='  '||bold||'Y'||normal||'es\'||bold||'N'||normal||'o'
  1321. if allopt=1 then
  1322.    ayn=ayn||'\'||bold||'A'||normal||'ll'
  1323. do forever
  1324.  foo1=normal||reverse||fooa||normal||ayn
  1325.  call charout,  foo1 normal ':'
  1326.  pull anans
  1327.  if abbrev(anans,'Y')=1 then return 1
  1328.  if abbrev(anans,'N')=1 then return 0
  1329.  if allopt=1 & abbrev(anans,'A')=1 then return 2
  1330.  
  1331. end
  1332.  
  1333. /* -------------------- */
  1334. /* get a yes or no , return 1 if yes */
  1335. yesno:procedure expose normal reverse bold
  1336. parse arg fooa , allopt,altans
  1337. if altans<>" " & words(altans)>1 then do
  1338.    w1=strip(word(altans,1))
  1339.    w2=strip(word(altans,2))
  1340.    a1=left(w1,1) ; a2=left(w2,1)
  1341.    a1a=substr(w1,2) ; a2a=substr(w2,2)
  1342. end
  1343. else do
  1344.     a1='Y' ; a1a='es'
  1345.     a2='N' ; a2a='o'
  1346. end  /* Do */
  1347. ayn='  '||bold||a1||normal||a1a||'\'||bold||a2||normal||a2a
  1348. if allopt=1 then  ayn=ayn||'\'||bold||'A'||normal||'ll'
  1349.  
  1350. do forever
  1351.  foo1=normal||reverse||fooa||normal||ayn
  1352.  call charout,  foo1 normal ':'
  1353.  pull anans
  1354.  if abbrev(anans,a1)=1 then return 1
  1355.  if abbrev(anans,a2)=1 then return 0
  1356.  if allopt=1 & abbrev(anans,'A')=1 then return 2
  1357. end
  1358.  
  1359.  
  1360. /* ------------------------ */
  1361. /* ask for directory name,use defname2 as default */
  1362. /* give user opportunity to create it */
  1363.  
  1364. get_dir:procedure expose normal reverse bold
  1365. /* procedure expose reverse normal bold */
  1366. parse arg defname2 , mustsub
  1367. defname0=defname2
  1368.  
  1369. n2:
  1370. call charout ,  reverse ' <ENTER>=' defname2  normal ' ?'
  1371. pull godir
  1372.  
  1373. if godir=" " then godir=defname2
  1374. if godir="n.a." then signal n2
  1375.  
  1376.  
  1377. if mustsub<>"" then do    /* check 'must be subdirectory' option */
  1378.   if abbrev(godir,mustsub)=0 then do
  1379.      say " This directory MUST be under the " mustsub " directory! "
  1380.      say "  .. please re enter ! "
  1381.      signal n2
  1382.   end
  1383. end
  1384.  
  1385. godir=strip(godir,'t','\')
  1386. gdname=godir||"\*.*"
  1387.  
  1388.  
  1389. isme=directory()
  1390.  
  1391. isnew=directory(godir)
  1392. if isnew="" then do
  1393.    say "    Could not find  " godir
  1394.    if yesno("        Would you like to create it")=1 then do
  1395.         oo=sysmkdir(godir)
  1396.         if oo=0  then
  1397.            say "      Directory created: " godir
  1398.         else do
  1399.            say "      Could not create " godir "(error = " oo
  1400.            if godir=defname2 then defname2= "n.a."
  1401.            signal n2
  1402.         end
  1403.    end
  1404.    else do
  1405.         say " please reenter directory name ... "
  1406.         if godir=defname2 then defname2= "n.a."
  1407.         signal n2
  1408.    end
  1409. end  /* Do */
  1410.  
  1411.  
  1412. isme=directory(isme)
  1413.  
  1414.  
  1415.  
  1416. return godir
  1417.  
  1418. /* ------------- */
  1419. /* ----------------------------------------------------------------------- */
  1420. /* REPLACESTRG: In string astring, find first occurence substring target and
  1421. .   replace it with substring putme
  1422. .      if no target, return unchanged astring
  1423. .      if no putme, then remove target
  1424. .      if type=backward, then find/change LAST occurence
  1425. .      if type=all, find/change all occurences
  1426. .      if exactmatch=yes, then do not capitalize during search (exact match only */
  1427. /* ----------------------------------------------------------------------- */
  1428.  
  1429. replacestrg: procedure
  1430.  
  1431. exactmatch=0
  1432. backward=0 ; doall=0
  1433.  
  1434. parse arg astring ,  target   , putme , type , exactmatch
  1435.  
  1436. type = translate(type)
  1437. if type="BACKWARD" then backward="YES"
  1438. if type="ALL" then doall="YES"
  1439.  
  1440. iat=1
  1441. joelen=length(target)
  1442. joelen2=length(putme)
  1443.  
  1444. doagain:                /* here if doall=yes */
  1445.  if exactmatch="YES" then do
  1446.     if   backward="YES" then
  1447.         joe= lastpos(target,astring)
  1448.     else
  1449.         joe= pos(target,astring,iat)
  1450.  end
  1451.  else do
  1452.    if   backward="YES" then
  1453.         joe= lastpos(translate(target),translate(astring))
  1454.     else
  1455.         joe= pos(translate(target),translate(astring),iat)
  1456.  end
  1457.  if joe=0 then
  1458.          return astring
  1459.  
  1460.  astring=delstr(astring,joe,joelen)
  1461.  if putme<>' ' then
  1462.     astring=insert(putme,astring,joe-1)
  1463.  
  1464.  if doall="YES" then do
  1465.      iat=joe+joelen2
  1466.      signal doagain
  1467.  end
  1468. /* else, all done */
  1469.  return astring
  1470.  
  1471. /* ----------------------------------------------------------------------- */
  1472. /* GRAB_FILE read in a file, but first check to see if openable, and if
  1473. .   openable, open and read it.
  1474. .    Returns with the file, or with 0 if file not obtainable.
  1475. .    Note that file is closed before returning
  1476. .   in,
  1477. .    usage:   afile_string=grab_file(the_file,seconds_to_try_for)
  1478. */
  1479. /* ----------------------------------------------------------------------- */
  1480.  
  1481.  
  1482. grab_file: procedure
  1483.  
  1484. parse arg afile
  1485.  
  1486. ause=stream(afile,'c','open read')
  1487. if ause<>"READY:" then
  1488.   return 0
  1489.  
  1490. goo=charin(afile,1,chars(afile))
  1491. ause=stream(afile,'c','close')
  1492.  
  1493. /* get rid of ending ctl-z */
  1494. if c2d(right(goo,1))=26 then
  1495.   goo=left(goo,length(goo)-1)
  1496.  
  1497. return goo
  1498.  
  1499.  
  1500. /*******************************************/
  1501. /* check for existence of file, then ask user to copy or not */
  1502. /* note that for X.* type copies, it only checks once
  1503.    (not for each file, but just for any one of them */
  1504. /********************************************/
  1505. check_copy: procedure expose copyall reverse bold normal
  1506. parse arg file1, dest1 , amess , noask
  1507.  
  1508. dest2=strip(dest1,'t','\')||'\'
  1509.  
  1510. filename=dest2||file1
  1511.  
  1512.  
  1513. if copyall=1 then signal doit3
  1514.  
  1515.  
  1516. aa=sysfiletree(filename,isit,'F')
  1517.  
  1518. ok=1
  1519. if aa<>0 then do
  1520.    say " Warning: error when looking for pre-existing copy of: " filename
  1521.    ok=yesno(" Do you want to copy this file (or files) anyways? ")
  1522.    if ok=1 & amess<>""  then
  1523.       ok=yesno(amess)
  1524. end
  1525.  
  1526. if noask=1 then signal doit3
  1527.  
  1528. if isit.0>0 then do
  1529.   if pos('*',file1)=0 then do
  1530.       say " "
  1531.       say " A file exists with the name: " filename
  1532.       ok=yesno(" Do you want to overwrite this file? ",1)
  1533.       if ok=1 & amess<>""  then
  1534.            ok=yesno(amess)
  1535.   end
  1536.   else do
  1537.     say " "
  1538.       say " There is at least one file that matches: " filename
  1539.       say "  (this match may " bold " not " normal " be one of the files that will be copied!) "
  1540.       ok=yesno(" Do you want to copy these files? ",1)
  1541.       if ok=1 & amess<>""  then
  1542.            ok=yesno(amess)
  1543.   end  /* Do */
  1544.  
  1545. end
  1546.  
  1547. if ok=2 then do
  1548.   say " "
  1549.   say "SRE-FILTER will overwrite all files "
  1550.   copyall=yesno(" Are you sure you want to do this?")
  1551.   if copyall=0 then
  1552.       ok=yesno(" Do you want to overwrite the current file (or files)? ")
  1553. end
  1554.  
  1555. if ok=0  then return 0
  1556.  
  1557. doit3:          /* jump here if copyall is on, or noask=1 */
  1558. 'COPY ' file1 dest1 ' > NUL '
  1559.  
  1560. return 1
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  /* ------------------------------------------------------------------ */
  1566.  /* function: Check if ANSI is activated                               */
  1567.  /*                                                                    */
  1568.  /* call:     CheckAnsi                                                */
  1569.  /*                                                                    */
  1570.  /* where:    -                                                        */
  1571.  /*                                                                    */
  1572.  /* returns:  1 - ANSI support detected                                */
  1573.  /*           0 - no ANSI support available                            */
  1574.  /*          -1 - error detecting ansi                                 */
  1575.  /*                                                                    */
  1576.  /* note:     Tested with the German and the US version of OS/2 3.0    */
  1577.  /*                                                                    */
  1578.  /*                                                                    */
  1579.  CheckAnsi: PROCEDURE
  1580.    thisRC = -1
  1581.  
  1582.    trace off
  1583.                          /* install a local error handler              */
  1584.    SIGNAL ON ERROR Name InitAnsiEnd
  1585.  
  1586.    "@ANSI 2>NUL | rxqueue 2>NUL"
  1587.  
  1588.    thisRC = 0
  1589.  
  1590.    do while queued() <> 0
  1591.      queueLine = lineIN( "QUEUE:" )
  1592.      if pos( " on.", queueLine ) <> 0 | ,                       /* USA */
  1593.         pos( " (ON).", queueLine ) <> 0 then                    /* GER */
  1594.        thisRC = 1
  1595.    end /* do while queued() <> 0 */
  1596.  
  1597.  InitAnsiEnd:
  1598.  signal off error
  1599.  RETURN thisRC
  1600.  
  1601.  
  1602.  
  1603.  
  1604. /* get the hostname (aa.bb.cc) for this machine */
  1605. get_hostname: procedure
  1606.     do queued(); pull .; end                   /* flush */
  1607.     address cmd '@hostname | rxqueue'
  1608.  
  1609.     parse pull hostname
  1610.     return hostname
  1611.  
  1612.  
  1613. set_params:procedure expose adefault aautoname awebmaster arealm ahomename assi ,
  1614.                 CY_YE BOLD NORMAL REVERSE thishost assicache ahomedir
  1615.  
  1616. /* Set some  "common parameters" */
  1617. enterparams:
  1618. say " If you like, you can customize a few of the initialization parameters."
  1619. say " If you choose not to, default values will be used "
  1620. adefault='INDEX.HTM'
  1621. aautoname=' *.HTML *.HTM  INDEX.HTML INDEX.HTM !CREATE '
  1622. awebmaster='The Webmaster '
  1623. parse var thishost  arealm '.' .
  1624. assi=0
  1625. ahomename='Our WWW site '
  1626. ahomedir='homedir/'
  1627. assicache='1'
  1628. ok=yesno('Would you like to customize a few "initialization parameters"')
  1629.  
  1630. if ok=1 then do
  1631.     say ' You will be asked to enter the values of several "initialization" parameters.'
  1632.     say ' You can edit the default values by using arrow keys, etc. '
  1633.    say ' '
  1634.  
  1635.    say bold "DEFAULT" normal " should be the HTML document to use as your site's Home Page. "
  1636.    say "    The " bold "DEFAULT" normal "is used when requests to the root directory "
  1637.    say "    of your server are recieved (that is, empty request selectors, "
  1638.    say "    as would be  generated by a URL of  http://xxx.yy.zzz/ )"
  1639.    thedef="INDEX.HTM"
  1640.     say reverse "DEFAULT? " normal
  1641.     adefault=stringin(,2,thedef,40)
  1642.     say " "
  1643.     say " "
  1644.  
  1645.    say bold "AUTO_NAME" normal " should contain a list of HTML documents that may be used as"
  1646.    say " the default document for a directory. These are used when requests to the "
  1647.    say " root of a" bold "directory" normal " are recieved. "
  1648.    say " For example: a URL of " bold " http://xxx.yy.zzz/books/classics/ " normal
  1649.    say "              would generate a request selector of: " bold "books/classics' " normal
  1650.    say "              -- and SRE-Filter would use AUTO_NAME to determine which file "
  1651.    say "                 (in the books/classics/ subdirectory) to use. "
  1652.    thedef="INDEX.HTM INDEX.HTML "
  1653.     say reverse "AUTO_NAME? " normal
  1654.     fooauto=stringin(,2,thedef,70)
  1655.     aautoname=fooauto
  1656.     say " "
  1657.     say " Before trying these files, SRE-Filter can look for  dirname.HTML and "
  1658.     say " dirname.HTM; where " bold "dirname" normal 'is the "deepest" part of the directory name '
  1659.     say "        For example, using the above example ( " bold " books/classics/" normal
  1660.     say "        SRE-Filter would first look for " bold "CLASSICS.HTML" normal "and" bold "CLASSICS.HTM" normal
  1661.     if length(fooauto) < 30 then do
  1662.         say "      ("fooauto " would be tried only if CLASSICS.HTML and "
  1663.         say "        and CLASSICS.HTM did not exist)"
  1664.     end
  1665.     else do
  1666.         say "       ("fooauto
  1667.         say "        would be tried only if CLASSICS.HTML and  CLASSICS.HTM did not exist)"
  1668.     end  /* Do */
  1669.     isdname=yesno(' Should SRE-Filter attempt this "directory name matching"?')
  1670.     if isdname=1 then aautoname=" *.HTML *.HTM "||aautoname
  1671.     say " Lastly, if none of the above work, SRE-Filter can display a list "
  1672.     say " of files and subdirectories. "
  1673.     isflist=yesno(' When all else fails, should SRE-Filter display a file listing?')
  1674.     if isflist=1 then aautoname=aautoname||' !CREATE '
  1675.     if isflist=1 then
  1676.         say " Note: by default, this file listing will NOT contain descriptions. "
  1677.     say ' '
  1678.  
  1679.  
  1680.     say  bold " WEBMASTER " normal " should contain the name (and address) of a contact person. "
  1681.     thedef=' <a href="mailto:webmaster@'thishost'">The WebMaster</a> '
  1682.     say reverse " WEBMASTER? " normal
  1683.     awebmaster=stringin(,2,thedef,80)
  1684.     say " ";say " "
  1685.  
  1686.     say bold " THE_REALM " normal "is used as your site's default " bold " realm. " normal
  1687.     say "       (the" bold "Realm" normal "is displayed when clients are asked to  "
  1688.     say "        enter a username and password). "
  1689.     parse var thishost thedef '.'
  1690.     say reverse " THE_REALM? " normal
  1691.     arealm=stringin(,2,thedef,40)
  1692.     say " "
  1693.     say " "
  1694.  
  1695.     say  bold " SSI_SHTML_ONLY " normal "is used to limit " bold " server side includes"
  1696.     say  normal  " to files that have " bold ' .SHTML ' normal "(or " bold " .SHT" normal ") extensions. "
  1697.     say  "      If SSI_SHTML_ONLY is not turned on, then all HTML document will "
  1698.     say  "      be checked for " bold "server side includes. " normal
  1699.     assi=yesno(' Only check .SHTML and .SHT files for server side includes? ')
  1700.     assi=word('NO YES',assi+1)
  1701.     say " "
  1702.  
  1703.  
  1704.     say  bold " SSI_CACHE_ON " normal "is used to enable the "bold"SSI-cache."normal
  1705.     say "The  "bold"SSI-cache"normal" is used to store pre-compiled versions of HTML documents "
  1706.     say "that contain server side includes (SSIs). When appropriate, "
  1707.     say "SRE-Filter will return these documents (perhaps with further modifications)."
  1708.     say  "    The use of the " bold"SSI-CACHE"normal" can significantly improve "
  1709.     say  "    response time. However, on very dynamic sites, there is a small "
  1710.     say  "    chance that out-of-date document will occasionally be returned.  "
  1711.     assicache=yesno(' Enable the SSI-CACHE (YES), or disable it (NO)? ')
  1712.     assicache=word('NO YES',assicache+1)
  1713.     say " " ; say " "
  1714.  
  1715.     say   bold " HOME_NAME " normal " should contain the colloquial name of your site."
  1716.     say  bold "        HOME_NAME " normal "  is used in certain descriptive responses,  "
  1717.     say       "         such as when a client asks for a non-existent file. "
  1718.     thedef="Our WWW site "
  1719.     say reverse " HOME_NAME? " normal
  1720.     ahomename=stringin(,2,thedef,70)
  1721.     say " " ;    say " "
  1722.  
  1723.     say   bold " HOME_DIR " normal " should contain which subdirectory (of your Goserve "
  1724.     say   "  directory) to use  when resolving requests containing a ~ character. "
  1725.     say   '  For example, if ' bold ' HOME_DIR=students/personal/ ' normal
  1726.     say   '  then a request selector of ~gerry.htm' normal 'would be equivalent '
  1727.     say   '  to ' bold 'students/personal/gerry.htm ' normal
  1728.     thedef="HOMEDIR/ "
  1729.     say reverse " HOME_DIR " normal
  1730.     ahomedir=stringin(,2,thedef,40)
  1731.     say " "
  1732.     say " "
  1733.  
  1734.   say  cy_ye " You have chosen the following settings: " normal
  1735.   say  " " reverse "DEFAULT:" normal adefault
  1736.   say  " " reverse "AUTO_NAME:" normal fooauto
  1737.  
  1738.   select
  1739.    when isdname=1 & isflist=1 then
  1740.      say          "            (with dirname.HTML checking, and file-listing if all else fails)"
  1741.    when isdname=1 then
  1742.      say          "            (with dirname.HTML checking)"
  1743.    when isflist=1 then
  1744.      say          "            (with file-listing if none of these exists)"
  1745.    otherwise
  1746.      nop
  1747.   end
  1748.   say " " reverse "HOME_DIR:" normal ahomedir
  1749.   say " " reverse "WEBMASTER:" normal awebmaster
  1750.   say " " reverse "THE_REALM:" normal arealm
  1751.   say " " reverse "HOME_NAME:" normal ahomename
  1752.   say " " reverse "SSI_SHTML_ONLY:" normal  assi
  1753.   say " " reverse "SSI_CACHE_ON:" normal  assicache
  1754.  
  1755.   say " "
  1756.   foo=yesno(" Are these okay? ")
  1757.   if foo=0 then signal enterparams
  1758. end
  1759. return 0
  1760.  
  1761.  
  1762.